package com.itheima.module.dao;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {

        /*SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();
        SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(App.class.getClassLoader().getResourceAsStream("SqlMapConfig.xml"));

        SqlSession sqlSession = sqlSessionFactory.openSession();


        UserDao userDao = sqlSession.getMapper(UserDao.class);*/


        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("factory/spring1.xml");


        SqlSessionFactory sqlSessionFactory = context.getBean(SqlSessionFactory.class);

        System.out.println(sqlSessionFactory);


    }
}
